package com.ncomz.cspace.login.controller;


import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.http.HttpSession;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;


/**
 * 
 * 1. ClassName		: LogoutController	
 * 2. FileName		: LogoutController.java
 * 3. Package		: com.ncomz.cspace.login.controller
 * 4. Comment		: 로그아웃했을때 해당 페이지 이동
 * 5. 작성자		: 이석균
 * 6. 작성일		: 2013. 8. 21. 오후 12:12:19
 */
@Controller
public class LogoutController {
	
	private static final Logger log = LoggerFactory.getLogger(LogoutController.class);
	
	@RequestMapping(value = "/logout.do")
	public String logout(HttpSession session){
		
		String curTime = new SimpleDateFormat("yyyy/MM/dd/HH:mm").format(new Date());
		
		log.info("logout 현재시간 : "+curTime);
		
		
		
		session.invalidate();			//session 종료(안에있는 데이터 다삭제)
				
		return "redirect:/loginpage.do";
	}
	
	@RequestMapping(value = "/logoutpage.do")
	public String loginpage(){
				

		return "/login/loginpage";
	}
}
